// 创建请求trademarkModel页面函数
import type {TradeMarkListData,TradeMark }from './model/trademarkDate'

import  request  from "@/utils/request"
enum Api {
  getTrademarkListApi = '/admin/product/baseTrademark',
   // 添加品牌
   saveTrademarkApi = '/admin/product/baseTrademark/save',
     // 删除品牌请求
  removeTrademarkApi = '/admin/product/baseTrademark/remove',
  // 修改一条数据
  updateTrademarkApi = '/admin/product/baseTrademark/update'
}


// 3. 获取品牌管理数据
export const reqGetTrademarkListData = (page: number, limit: number) => {
  // return request.get<any, TrademarkListDataModel>(`/${page}/${limit}`)
  return request.get<any, TradeMarkListData>(`${Api.getTrademarkListApi}/${page}/${limit}`)
}

// 4.添加品牌请求
export const reqSaveTrademarkInfo = (trademark:TradeMark)=>{
  return request.post<any,null>(Api.saveTrademarkApi,trademark)
}

//5. 发送请求删除某一条商品信息
export const reqDeleteTrademarkInfo = (id:Number)=>{
  return request.delete<any,null>(`${Api.removeTrademarkApi}/${id}`)
}

// 6.修改一条数据
export const reqUpdateTrademarkInfo = (trademark:TradeMark)=>{
return request.put(Api.updateTrademarkApi,trademark)
}
